package com.lr.frame.common.colorful.aop;

import java.util.HashMap;
import java.util.Map;

public class StationAspect implements AspectHandler {
ThreadLocal<Map<String,Object>> th=new ThreadLocal<Map<String,Object>>();
{
	th.set(new HashMap<String, Object>());
}
	public void befor() {
		System.out.println("==============开启事物");
		th.get().put("curentSession", true);
		
	}

	public void throwing() {
		System.err.println("==============回滚事物");
		th.get().put("curentSession", false);
	}

	public void after() {
		Boolean b=(Boolean)th.get().get("curentSession");
		if(b!=null&&b)
		System.out.println("==============提交事物");
	}

}
